#ifndef CONTROLLER_H
#define CONTROLLER_H

#include <QObject>

class CommunicationProxy;
class ControllerPrivate;

#define CInstance Controller::instance()

class Controller : public QObject
{
    Q_OBJECT

public:
    static Controller *instance();

public:
    explicit Controller(QObject *parent = nullptr);
    ~Controller();

    void setkp(float kp);
    float kp() const;

    void setki(float ki);
    float ki() const;

    void setkd(float kd);
    float kd() const;

    void setTarget(float target);
    float target() const;

    CommunicationProxy *communicationProxy() const;


public Q_SLOTS:
    void onTemperatureChanged(float temperature);

Q_SIGNALS:
    void adjustValueReady(float v);

private:
    ControllerPrivate *d;
    friend class ControllerPrivate;

};

#endif // CONTROLLER_H
